package com.cheng.commonutlis.avtivity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.cheng.commonlibrary.utlis.BroadCastUtils;

import java.io.Serializable;
import java.util.List;

public class BroadCastActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        BroadCastUtils.getInstance().sendBroadcast("发送通知标识", "");


        BroadCastUtils.getInstance().addAction("接收通知", new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                // 拿到的数据进行强转
                String str = (String) intent.getSerializableExtra(BroadCastUtils.DATA);
            }
        });

    }
}
